<% layout("/common/layout.html",{"title":"工商申请列表"}){ %>
<div class="row wrapper border-bottom white-bg page-heading">
    <div class="col-sm-8">
        <h2>工商申请列表</h2>
        <ol class="breadcrumb">
            <li><a href="${ctxPath}/admin/main">主页</a></li>
            <li class="active">工商申请列表</li>
        </ol>
    </div>
    <!--<div class="col-sm-4">-->
        <!--<div class="title-action">-->
            <!--<a class="btn btn-primary btn-sm btn-outline" href="/companyApply/view/report/1"><i class="fa fa-bar-chart" aria-hidden="true"></i> 查看统计报表</a>-->
        <!--</div>-->
    <!--</div>-->
</div>
<div class="wrapper wrapper-content">
    <div class="row">
        <form id="searchForm">
            <div class="ibox-content m-b-sm border-bottom">
                <div class="row">
                    <div class="col-sm-4">
                        <div class="form-group">
                            <label class="control-label" for="searchValue">企业名称/申请编号/申请人：</label>
                            <input type="text" class="form-control" id="searchValue" name="searchValue" placeholder="支持企业名称、申请编号、申请人的模糊查询">
                        </div>
                    </div>

                    <div class="col-sm-2">
                        <div class="form-group">
                            <label class="control-label" for="companyAddress">公司地址：</label>
                            <input type="text" class="form-control" id="companyAddress" name="companyAddress" placeholder="公司地址，支持模糊查询">
                        </div>
                    </div>

                    <div class="col-sm-2">
                        <div class="form-group">
                            <label class="control-label" for="applyStatus">申请状态：</label>
                            <select class="form-control" id="applyStatus" name="applyStatus">
                                <option value="">全部</option>
                                <% for(status in companyApplyStatus){ %>
                                <option value="${status.key}">${status.value}</option>
                                <%  } %>
                            </select>
                        </div>
                    </div>

                    <div class="col-sm-2">
                        <div class="form-group">
                            <label class="control-label" for="applyTime">申请时间：</label>
                            <input class="form-control" type="date" id="applyTime" name="applyTime">
                        </div>
                    </div>


                    <div class="col-sm-2 pull-right">
                        <div class="form-group">
                            <label class="control-label" for="search">&nbsp;</label>
                            <div class="btn-block text-right">
                                <button type="button" id="search" class="btn btn-primary "><i class="fa fa-search"></i>&nbsp;搜 索&nbsp;</button>
                                <button type="button" id="reset" class="btn btn-danger"><i class="fa fa-undo"></i>&nbsp;重 置&nbsp;</button>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </form>

        <!-- 表格-->
        <div class=" animated fadeInDown">
            <div class="mail-box">
                <div class="ibox-content">
                    <table id="dataList"></table>
                    <div class="toolBar pull-right">
                            <div class="btn-group">
                                <a href="wait" class="btn btn-primary btn-outline ${currentAction == 'wait'?'active'}"><i class="fa fa-edit" aria-hidden="true"></i>&nbsp;待补数据</a>
                                <a href="index" class="btn btn-primary btn-outline ${currentAction == 'index'?'active'}"><i class="fa fa-lock" aria-hidden="true"></i>&nbsp;申请认领</a>
                                <a href="handle" class="btn btn-primary btn-outline ${currentAction == 'handle'?'active'}"><i class="fa fa-retweet" aria-hidden="true"></i>&nbsp;审核办理</a>
                                <a href="refuse" class="btn btn-primary btn-outline ${currentAction == 'refuse'?'active'}"><i class="fa fa-reply" aria-hidden="true"></i>&nbsp;退回修改</a>
                                <a href="pass" class="btn btn-primary btn-outline ${currentAction == 'pass'?'active'}"><i class="fa fa-check" aria-hidden="true"></i>&nbsp;核准通过</a>
                                <a href="invalid" class="btn btn-primary btn-outline ${currentAction == 'invalid'?'active'}"><i class="fa fa-trash" aria-hidden="true"></i>&nbsp;作废失效</a>
                            </div>
                    </div>
                </div>
            </div>
        </div>
        <!-- 表格-->
    </div>
</div>
<% } %>
<script type="text/javascript">
    //页面JS调用
    require(['company/apply'], function (apply) {
        apply.list('${currentAction}');
    });
    //列表参数
    function operateFormatter(value, row, index) {
        var tempCode = "";
        <%  if(shiro.hasPermission("/companyApply/save/action")) { %>
            if(row.applyStatus === 1){
                tempCode += '<button type="button" class="claim btn btn-white"><i class="fa fa-lock"></i>&nbsp;认领&nbsp;</button>';
            }else if(row.applyStatus === 2){
                tempCode += '<button type="button" class="handle btn btn-white"><i class="fa fa-retweet"></i>&nbsp;审核&nbsp;</button>';
            }
        <% } %>
        <%  if(shiro.hasPermission("/companyApply/delete/action")) { %>
            tempCode += '<button type="button" class="delete btn btn-white">&nbsp;<i class="fa fa-trash"></i>&nbsp;删除&nbsp;</button>';
        <%  } %>
        if(row.applyStatus === 4){
            tempCode += '<button type="button" class="print btn btn-white"><i class="fa fa-print"></i>&nbsp;打印&nbsp;</button>';
        }
        tempCode += '<button type="button" class="info btn btn-white"><i class="fa fa-info-circle"></i>&nbsp;详情&nbsp;</button>';
        return '<div class="btn-group">' + tempCode + '</div>';
    }
</script>